home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 6
/
BUGCD1997_09.BIN
/
APLIC
/
PAGEMAKR
/
ARCHIVE.Z
/
Nested Ungroup.SPT
< prev
next >
Wrap
Text File
|
1996-10-31
|
2KB
|
76 lines
-- Nested Ungroup
-- 1 Oct 96, vs
-- This script will allow you to ungroup a group created
-- with the "nested group" script. After running this script
-- the original groups will be retained.
getselectidlisttop => n,ID,...,...,...,type,...
if not(n,type=1,14)
return
endif
try getprivatestring "Vlad","NGrp",classobject,0,ID =>..., TOC
if empty(TOC)
ungroup
return
endif
set ~""(TOC)=>TOC
while not(empty(TOC))
set TOC=>i,TOC
getprivatestring "Vlad","NGrp",classobject,i,ID =>..., g[i]
set ~""(g[i]) => g[i]
endwhile
ungroup
deselect
set g[ID]=>root
while not(empty(root))
if root(1)>0
break
endif
set root=>G,root
set g[-G]=>group
if group(1)>0
rem select'em all & group
while not(empty(group))
set group=>k,group
try selectidextend k
endwhile
try group
deselect
else
set => toc
while group(1)<0
set group=>i,group
set g[-i]=>gi
set toc,-i=>toc
loop j=1,len(gi)
if gi(j)<0
set gi(j),group=>group
else
set group,gi(j)=>group
endif
endloop
endwhile
rem select'em all;group;assign private data by 'toc' and new group id
deselect
while not(empty(group))
set group=>k,group
selectidextend k
endwhile
group
getselectidlisttop => ...,id,...
privatestring "Vlad","NGrp",classobject,0,1,id,1,""(id,toc)
privatestring "Vlad","NGrp",classobject,id,1,id,1,""(g[-G])
while not(empty(toc))
set toc=>k,toc
privatestring "Vlad","NGrp",classobject,k,1,id,1,""(g[k])
endwhile
deselect
endif
endwhile
return